/* Copyright (c) 2014 - 2024 Qualcomm Technologies International, Ltd. */
/* %%version */

#ifndef GATT_DEVICE_INFO_SERVER_PRIVATE_H
#define GATT_DEVICE_INFO_SERVER_PRIVATE_H

#include "gatt_device_info_server.h"
#include "csr_bt_gatt_lib.h"


#ifndef CSR_BT_GATT_INSTALL_FLAT_DB
#define HANDLE_DEVICE_INFORMATION_SERVICE (0x0000)
#define HANDLE_MANUFACTURER_NAME          (0x0002)
#define HANDLE_MODEL_NUMBER               (0x0004)
#define HANDLE_SERIAL_NUMBER              (0x0006)
#define HANDLE_HARDWARE_REVISION          (0x0008)
#define HANDLE_FIRMWARE_REVISION          (0x000A)
#define HANDLE_SOFTWARE_REVISION          (0x000C)
#define HANDLE_SYSTEM_ID                  (0x000E)
#define HANDLE_IEEE_DATA                  (0x0010)
#define HANDLE_PNP_ID                     (0x0012)
#define HANDLE_DEVICE_INFORMATION_SERVICE_END (0x0012)

#define CSR_BT_DEVICE_INFO_SRV_DB_HANDLE_COUNT 19


/* Macros for creating messages */
#define MAKE_DEVICE_INFO_MESSAGE(TYPE) TYPE##_T *message = (TYPE##_T*)CsrPmemZalloc(sizeof(TYPE##_T))

#define DisMessageSend(TASK, ID, MSG) {\
    MSG->id = ID; \
    CsrSchedMessagePut(TASK, DIS_SERVER_PRIM, MSG);\
    }

#endif

/* Device Info Server expose only one instance on a device */
typedef struct __GDISS_T
{
    gdiss_t *deviceInfo;
} GDISS_T;

typedef struct DisInstanceListElement
{
    struct DisInstanceListElement    *next;
    struct DisInstanceListElement    *prev;
    CsrBtGattId                      gattId;
    gdiss_t                          *pDis;
} DisInstanceListElm_t;

#ifndef CSR_BT_GATT_INSTALL_FLAT_DB
CsrBtGattDb * CsrBtDeviceInfoSrvDbCreate(CsrUint16 handleOffset);
#endif

#endif /* GATT_DEVICE_INFO_SERVER_PRIVATE_H */
